package mutsumimod.relics;

import com.megacrit.cardcrawl.actions.common.ApplyPowerAction;
import com.megacrit.cardcrawl.actions.common.DrawCardAction;
import com.megacrit.cardcrawl.actions.common.GainBlockAction;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.relics.AbstractRelic;
import mutsumimod.MutsumiMod;
import mutsumimod.actions.TriggerStandAction;
import mutsumimod.character.Mutsumi;
import mutsumimod.powers.StandPower;

public class Cucumutsu extends BaseRelic {
    public static final String ID = MutsumiMod.makeID(Cucumutsu.class.getSimpleName());
    public static final String IMG_NAME = "Cucumutsu";

    public Cucumutsu() {
        super(ID, IMG_NAME, Mutsumi.Meta.CARD_COLOR, RelicTier.STARTER, LandingSound.CLINK);
    }

    public final static int CARD=1;
    public final static int BLOCK=4;

    @Override
    public void atTurnStart() {
        flash();
        AbstractPlayer p = AbstractDungeon.player;
        int amount=0;
        if(p.hasPower(StandPower.POWER_ID)){
            amount=p.getPower(StandPower.POWER_ID).amount;
        }
        if(amount<3){
            addToBot(new DrawCardAction(CARD));
            addToBot(new ApplyPowerAction(p,p,new StandPower(p,1),1));
        }else{
            addToBot(new GainBlockAction(p,BLOCK));
        }

    }

    @Override
    public String getUpdatedDescription() {
        return DESCRIPTIONS[0]+BLOCK+DESCRIPTIONS[1]+CARD+DESCRIPTIONS[2];
    }

    @Override
    public AbstractRelic makeCopy() {
        return new Cucumutsu();
    }

}
